<%@page import="entity.bookmanage"%>
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>



<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>My JSP 'index.jsp' starting page</title>
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
  </head>
    
  <%
   List<bookmanage> list=(List<bookmanage>)request.getAttribute("list");
     if(list==null){
        request.getRequestDispatcher("BooksServlet?opr=sel").forward(request, response);
     return;
     }
 %>
  <body>
       <table>
         <tr>
            <td colspan="5"><h1>图书信息</h1></td>
         </tr>
          <tr>
             <td>图书名称</td>
             <td>图书作者</td>
             <td>购买时间</td>
             <td>图书分类</td>
             <td>操作</td>
          </tr>
          <c:forEach items="${list }" var="bk">
             <tr>
               <td>${bk.b_name }</td>
               <td>${bk.b_author }</td>
               <td>${bk.b_time }</td>
               <td>${bk.b_type }</td>
               <td><a href="BooksServlet?opr=del&id=${bk.b_id}">删除</a></td>
             </tr>
          
          </c:forEach>
         
       </table>
        <a href="add.jsp">新增图书信息</a>
  </body>
</html>
